package com.eastfair.transport.config;//package com.eastfair.auth.config;
//
//import io.seata.spring.annotation.GlobalTransactionalInterceptor;
//import org.aspectj.lang.annotation.Aspect;
//import org.springframework.aop.Advisor;
//import org.springframework.aop.aspectj.AspectJExpressionPointcut;
//import org.springframework.aop.support.DefaultPointcutAdvisor;
//import org.springframework.boot.autoconfigure.AutoConfigureAfter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Aspect
//@Configuration
//@AutoConfigureAfter(MybatisPlusAutoConfig.class)
//public class SeataConfig {
//    @Bean
//    public GlobalTransactionScanner getGlobalTransactionScanner(){
//        /**
//         * 以下参数为是无效参数,具体可以查看该类源码
//         */
//        return new GlobalTransactionScanner("auth","ef_dev_tx_group");
//    }
//
//    private static final String AOP_POINTCUT_EXPRESSION = "@annotation(io.seata.spring.annotation.GlobalTransactional)";
//
//    @Bean
//    public GlobalTransactionalInterceptor globalTransactionalInterceptor(){
//        GlobalTransactionalInterceptor globalTransactionalInterceptor = new GlobalTransactionalInterceptor(null);
//        return globalTransactionalInterceptor;
//    }
//
//    @Bean
//    public Advisor seataAdviceAdvisor() {
//        AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
//        pointcut.setExpression(AOP_POINTCUT_EXPRESSION);
//        return new DefaultPointcutAdvisor(pointcut,globalTransactionalInterceptor());
//    }
//}
